package tsing.javase.mapstruct_use;

import org.mapstruct.MapMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @Date 2024/9/20 11:27
 * @Author Tsing
 */
@Mapper
public interface StudentDOConvert {

    StudentDOConvert INSTANCE = Mappers.getMapper(StudentDOConvert.class);

    @Mapping(target = "name",
            expression = "java(tsing.javase.mapstruct_use.ConvertUtil.covertName(student.getName()))")
    StudentDO  mystdConvert(MyStudent student);
}
